﻿package mortal.component.windowTip
{
    import flash.utils.*;
    import mortal.game.view.common.*;

    public class WindowTipManager extends Object
    {
        public var dic:Dictionary;
        private static var _instance:WindowTipManager;

        public function WindowTipManager()
        {
            this.dic = new Dictionary();
            return;
        }// end function

        public static function showTip(param1:WindowTipData) : void
        {
            var _loc_2:* = instance.dic[param1.type] as WindowTip;
            if (_loc_2 == null)
            {
                _loc_2 = UIFactory.getUICompoment(WindowTip);
                instance.dic[param1.type] = _loc_2;
            }
            if (_loc_2.isHide == false)
            {
                _loc_2.hide();
                return;
            }
            _loc_2.show();
            _loc_2.data = param1;
            return;
        }// end function

        public static function hideTip(param1:String) : void
        {
            var _loc_2:* = instance.dic[param1] as WindowTip;
            if (_loc_2 && !_loc_2.isHide)
            {
                _loc_2.hide();
            }
            return;
        }// end function

        public static function dispose(param1:String) : void
        {
            var _loc_2:* = instance.dic[param1];
            if (_loc_2)
            {
                delete instance.dic[param1];
                _loc_2.dispose();
            }
            return;
        }// end function

        private static function get instance() : WindowTipManager
        {
            if (_instance == null)
            {
                _instance = new WindowTipManager;
            }
            return _instance;
        }// end function

    }
}
